<!DOCTYPE html>
<html>
<include file="Public:header" />
<link href="__ACSS__/dialog.css" rel="stylesheet">
<link href="__ACSS__/plugins/validform/validform.css" rel="stylesheet">
<style>
	.form-control{ padding-left:5px;}
	.file-preview-frame .btn{ float:right; margin-top:5px;}
	.purchase-box span{ border:1px solid #ddd; padding:3px 10px; border-radius:4px; float:left; background:#fff; font-size:15px; position:relative; cursor:pointer; margin:0 10px 10px 0;}
	.purchase-box span i{ margin-left:8px; color:#888;}
	.purchase-box span:hover{ border:1px solid #999; background:#eee;}
</style>
  <body>
	  <div class="wrapper wrapper-content animated fadeInRight">
	  	<form role="form" class="form" action="__URL__/insert">
			<input type="hidden" name="flag" value="1">
			<input type="hidden" name="create_time" value="<php>echo time();</php>">
			<input type="hidden" name="product_id" value="<php>echo $product_id;</php>">
			<div class="form-group">
				<label class="col-sm-2 control-label">类别：</label>
				<div class="col-sm-10">
					<div class="col-sm-6" style="padding-left:0;">
						<select name="attr_id" class="form-control" datatype="*" id="attr_id">
							<foreach name="attribute" item="attribute">
								<option value="<{$attribute.id}>"><{$attribute.name}></option>
							</foreach>
						</select>
					</div>
					<div class="col-sm-6" style="padding-right:0;">
						<input type="text" datatype="*" name="attr_value_name" class="form-control" placeholder="规格值名称">
					</div>
				</div>
				<br/>
				<div class="clearfix"></div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">是否默认：</label>
				<div class="col-sm-10">
					<label><input name="is_default" type="radio" value="0" checked="checked" />否</label>
					<label><input name="is_default" type="radio" value="1" />是</label>
				</div>
			</div>
			<div class="clearfix">
				<button type="submit" id="submit" class="btn btn-success btn-block">提交</button>
				<button type="reset" id="reset2" class="btn btn-success btn-block hidden">重置</button>
			</div>
		</form>
	  </div>
  </body>
<!-- 全局js -->
<include file="Public:foot" />
<script src="__AJSPLUGINS__/validform/Validform_v5.3.2_min.js"></script>
<script src="__AJS__/jquery.md5.js"></script>
<script>
$(function(){
	$("#reset2").click();
	var index = parent.layer.getFrameIndex(window.name);
	var form = $(".form").Validform({
		tiptype:4,
		ajaxPost:true,
		callback:function(data){
			if(data.status == 1) {
				window.parent.layer.msg(data.info);
				window.parent.$('#table_list').trigger("reloadGrid");
			}else{
				window.parent.layer.msg(data.info);
			}
			parent.layer.close(index);
		}
	});
})
</script>
</html>